/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.system;

import com.enation.app.javashop.client.system.SettingClient;
import com.enation.app.javashop.core.client.fallback.system.SettingClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.base.SettingGroup;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author fk
 * @version v2.0
 * @Description:
 * @date 2018/7/31 11:18
 * @since v7.0.0
 */
@FeignClient(name = "system-service",fallbackFactory = SettingClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface SettingClientFeignImpl extends SettingClient {

    /**
     * 系统参数配置
     *
     * @param group    系统设置的分组
     * @param settings 要保存的设置对象
     */
    @Override
    @RequestMapping(value = "/client/system/settings",method = RequestMethod.POST)
    void save(@RequestParam("group") SettingGroup group, @RequestBody Object settings);

    /**
     * 获取配置
     *
     * @param group 分组名称
     * @return 存储对象
     */
    @Override
    @RequestMapping(value = "/client/system/settings",method = RequestMethod.GET)
    String get(@RequestParam("group") SettingGroup group);
}
